package com.genewu.cloud.jdbc.core;

import com.genewu.util.PropertiesUtil;

import java.sql.Driver;
import java.util.Properties;

public abstract class DriverCore implements Driver {

    public static final String CLASS_NAME = DriverCore.class.getName();

    protected Properties properties;

    protected abstract String getDriverName();

    public DriverCore() {
       properties  = PropertiesUtil.loadPropertiesClasspath(getDriverName() + ".properties");
    }

	public final int getMajorVersion() {
        return Integer.parseInt(properties.getProperty("version.major"));
	}

	public final int getMinorVersion() {
        return Integer.parseInt(properties.getProperty("version.minor"));
	}

}
